#include "udp_client.h"

int main(int argc, char** argv)
{
    uint8_t cnt = 0;
    UdpClient comm_app;

    comm_app.Init("192.168.1.13", 8899);
    comm_app.Start();
    comm_app.RegCallback([](uint8_t* data, int32_t len){
        printf("get data\n");
    });
    std::thread thread1 = std::thread([&](){
        while (true)
        {
            /* code */
            char key = std::getchar();

            comm_app.SendData(&cnt, 1);
            printf("cnt:%d\n",cnt);
            cnt++;

        }
        
        
    });

    while (true)
    {
        // printf("cnt:%d\n",cnt);
        std::this_thread::sleep_for(std::chrono::milliseconds(20));
    }

    comm_app.Stop();
    printf("over!!!\n");

    return 0;
}